package com.csi.okr.common.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.ValueFilter;

public class JsonUtil {
	
	/**
	 * FASTJSON过滤器
	 */
	private static ValueFilter filter = new ValueFilter() {
		@Override
		public Object process(Object obj, String s, Object v) {
			if (v == null)
				return "";
			return v;
		}
	};
	
	/**
	 * Json数据转换 - NULL => ""
	 * @param data
	 * @return
	 */
	public static Object parseJson(Object data){
		
		return JSON.toJSONString(data,filter);
	}

}
